package com.sskj.api.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import lombok.Data;

import java.time.LocalDateTime;

@TableName("position")
@Schema(description = "岗位")
@Data
public class Position {

    @Schema(description = "主键ID")
    @TableId(type = IdType.ASSIGN_ID)
    private Long id;

    @Schema(description = "名称")
    @NotBlank(message = "岗位名称不能为空")
    private String name;

    @NotNull(message = "所属部门不能为空")
    @TableField("department_id")
    private Long departmentId;

    @Schema(description = "部门名称")
    @TableField(exist = false)
    private String departmentName;

    @Schema(description = "类型[1:管理岗|2:技术岗|9:普通岗]")
    private Integer type;

    @Schema(description = "状态[0:禁用|1:启用]")
    private Integer status;

    @Schema(description = "描述")
    private String description;

    @Schema(description = "排序")
    @TableField("sort_order")
    private String sortOrder;

    @TableField("create_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createTime;

    @TableField("update_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime updateTime;
}
